/**
 * related to temple_cell.ui
 * 
 * @Author : wzgl5533
 * @Timestamp : 2017-07-29
 */

var root = ui("$");
var dojs = require("dojs");
var do_Page = sm("do_Page");

var prayButton = ui("do_Button_2");
var ly = ui("do_LinearLayout_1");
root.setMapping({
	"do_ImageView_1.source":"albumPath",
	"do_Label_temple_name.text":"templeName",
	"do_Label_province.text":"province",
	"do_LinearLayout_1.tag":"item",
	"do_Button_2.tag":"status"
});

dojs.style.css(prayButton,"dynamicButton");
dojs.page.onTouch(prayButton,function(){
	do_Page.fire("selectItem",ly.tag);
});
//订阅每次绑定数据后的事件
root.on("dataRefreshed",function(){
	if (prayButton.tag == "JOIN") {
		prayButton.enabled = true;
		prayButton.bgColor = "D6A045FF";
		prayButton.text = "我要请香";
	}else {
		prayButton.enabled = false;
		prayButton.bgColor = "888888FF";
		prayButton.text = "暂未开通";
	}
});